﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<CognisessDA.User>>" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<div id="dvUsers">
    <h2>
        User Master</h2>
    <table>
        <tr>
            <th>
                Id
            </th>
            <th>
                User Name
            </th>
            <th>
                First Name
            </th>
            <th>
                Last Name
            </th>
            <th>
                Last Login
            </th>
            <th>
                Create Time
            </th>
            <th>
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%= Html.Encode(item.Id) %>
            </td>
            <td>
                <%= Html.Encode(item.Username) %>
            </td>
            <td>
                <%= Html.Encode(item.Firstname) %>
            </td>
            <td>
                <%= Html.Encode(item.Lastname) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.LastLogin)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.CreateTime)) %>
            </td>
            <td align="center">
                <a href="/UserMaster/Edit/<%=item.Id %>">
                    <img src='../../Content/images/backstage_img5.gif' alt="Edit" /></a> <a href="/UserMaster/Details/<%=item.Id %>">
                        <img src='../../Content/images/backstage_img7.gif' alt="Details" /></a>
                <a href="/UserMaster/Delete/<%=item.Id %>">
                    <img src='../../Content/images/backstage_img4.gif' alt="Delete" onclick="return confirm('Are you sure to delete this record?');" /></a>
            </td>
        </tr>
        <% } %>
    </table>
    <%= Html.AjaxPager(Model, new PagerOptions { CssClass = "mvcPager",AutoHide=false ,ShowMorePagerItems=false, ShowGoButton=false, PageIndexParameterName = "id", AlwaysShowFirstLastPageNumber = true, ShowPageIndexBox = true, PageIndexBoxWrapperFormatString = "Page {0}" }, new AjaxOptions { UpdateTargetId = "dvUsers" })%>
    <p style="margin-top: 10px;">
        <%= Html.ActionLink("Create New", "Create")%>
    </p>
</div>
